package com.harmontronics.hanma.paas.paas.domain.app.repository.persistence;

import java.util.Map;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.harmontronics.hanma.paas.paas.domain.app.entity.valueobject.Fields;
import com.harmontronics.hanma.paas.paas.domain.app.repository.mapper.HmHttpServiceMapper;
import com.harmontronics.hanma.paas.paas.domain.app.repository.po.HmHttpServicePO;
import org.springframework.stereotype.Repository;


@Repository("hmHttpServiceRepository")
public class HmHttpServiceRepository extends ServiceImpl<HmHttpServiceMapper, HmHttpServicePO> {

    public IPage<HmHttpServicePO> selectPage(QueryWrapper<HmHttpServicePO> queryWrapper, Page<HmHttpServicePO> page) {
        return baseMapper.selectPage(page, queryWrapper);
    }

    public HmHttpServicePO findByKey(String key) {
        QueryWrapper<HmHttpServicePO> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq(Fields.KEY_DB,key);
        return baseMapper.selectOne(queryWrapper);
    }
}